package cn.uyunsky.platform.config.bean.menu;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 * <p>
 * 一个交易树,对应界面的一个交易tree,可以存在多个tree
 * <p>
 * 每个<code>树</code>包含一组<code>菜单</code>和一个<code>模块</code>列表
 * 
 * @author baiyh
 * @date 2011-1-22
 */
public class PlTree {

	private String id;
	private String treename;
	private Set<PlModule> modules = new LinkedHashSet<PlModule>();
	private Set<PlTran> trans = new LinkedHashSet<PlTran>();

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTreename() {
		return treename;
	}

	public void setTreename(String treename) {
		this.treename = treename;
	}

	public Set<PlModule> getModules() {
		return modules;
	}

	public void setModules(Set<PlModule> modules) {
		this.modules = modules;
	}

	public void addModule(PlModule module) {
		modules.add(module);
	}

	public Set<PlTran> getTrans() {
		return trans;
	}

	public void setTrans(Set<PlTran> trans) {
		this.trans = trans;
	}

	public void addTrans(PlTran tran) {
		trans.add(tran);
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("PlTree [id=");
		builder.append(id);
		builder.append(", modules=");
		builder.append(modules);
		builder.append(", trans=");
		builder.append(trans);
		builder.append(", treename=");
		builder.append(treename);
		builder.append("]");
		return builder.toString();
	}

}
